/**
 * Created by Administrator on 2017/01/18 0020.
 */

'use strict';
var React = require('react-native');
var rnImageUtil = React.NativeModules.RNImageUtil;

class RNImageUtil {

    screenshot(fromx, fromy, width, height) {
        return new Promise((fulfill, reject) => {
            rnImageUtil.screenshot(fromx, fromy, width, height, (error, uri) => {
                if (error) {
                    reject(error);
                } else {
                    fulfill(uri);
                }
            });
        });
    }

}
module.exports = new RNImageUtil();